﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class WebApplication_MasterPageAdmin : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["RoleCode"] != null)
        {
            if (Convert.ToInt32(Session["RoleCode"]) !=1)
            {
                lbtName.Text = Session["Username"].ToString();
            }
            else
                Response.Redirect("Default.aspx");
        }
        else
            Response.Redirect("Login.aspx");
    }
    protected void lbtName_Click1(object sender, EventArgs e)
    {
        Response.Redirect("AccountDetails.aspx");
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Session["RoleCode"] = null;
        Session["Username"] = null;
        Response.Redirect("Login.aspx");
    }
}
